package com.bases.cellItem
{
	import com.bases.TCheckButton;
	import com.bases.TUIComponent;
	import com.Interface.ICheckBoxCellRender;
	import com.Interface.IItem;
	
	import flash.events.MouseEvent;
	
	/**
	 * 最底层的多选列表ItemRender 
	 * @author pethan
	 * 
	 */	
	public class BaseCheckCellItem extends TUIComponent implements IItem,ICheckBoxCellRender
	{
		protected var check:TCheckButton;
		protected var _data:*;
		public function BaseCheckCellItem()
		{
			this.check=new TCheckButton();
			this.check.setPos(2,2);
			this.addChild(this.check);
			this.addEventListener(MouseEvent.CLICK,onClick);
		}
		
		private function onClick(event:MouseEvent):void{
			this.select = !select;
			//发事件出去
		}
		
		/**
		 * 设置选中 
		 * @param value
		 * 
		 */		
		public function set select(value:Boolean):void{
			this.check.select=value;
		}
		
		/**
		 * 获取当前是否是选中的状态 true:选中,false为不选中 
		 * @return bool
		 * 
		 */		
		public function get select():Boolean{
			return this.check.select;
		}
		
		public function set userData(value:*):void{
			_data=value;
		}
		
		public function get userData():*{
			return _data;
		}
	}
}